<template>
  <div>
    <h1>品牌管理</h1>
    <hr />
    品牌名称<el-input
      v-model="input"
      placeholder="请输入内容"
      style="width: 200px"
    ></el-input>
    <el-button icon="el-icon-search" circle>查询</el-button>
    <el-button type="primary" @click="chong">重置</el-button>
    <template>
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column prop="name" label="品牌名称" width="120">
        </el-table-column>
        <el-table-column prop="created_at" label="修改时间" width="250">
        </el-table-column>
        <el-table-column prop="updated_at" label="创建时间" width="250">
        </el-table-column>
        <el-table-column label="操作" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button
              type="primary"
              icon="el-icon-edit"
              circle
              @click="
                $router.push('/admin/goods_brands/form?id=' + scope.row.id)
              "
              >编辑</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: "",
      tableData: [],
    };
  },
  created() {
    this.huo();
  },
  methods: {
    huo() {
      this.http
        .get(
          `http://118.190.80.166:48010/api/Admin/goods_brands?page=1&per_page=30`
        )
        .then((res) => {
          this.tableData = res.data.data.data;
          console.log(this.tableData);
        });
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
  },
};
</script>

<style lang="scss" scoped>
</style>